package com.edu.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.edu.bean.Admin;
import com.edu.bean.Orders;
import com.edu.bean.Page;
import com.edu.bean.User;
import com.edu.dao.AdminDao;
import com.edu.dao.impl.AdminDaoImpl;
import com.edu.service.AdminService;

public class AdminServiceImpl implements AdminService{
	AdminDao ad = new AdminDaoImpl();
	@Override
	public Map<String,Object> selectAll(String username, String password) {
		Map<String,Object> map = new HashMap();
		Admin loginAdmin = ad.selectAll(username, password);;
		if(loginAdmin != null) {
			map.put("loginAdmin",loginAdmin);
		}else {
			loginAdmin = ad.selectadminname(username);
			if(loginAdmin == null) {
				map.put("msg","用户名不存在");
			}else {
				map.put("msg","密码错误");
			}
		}
		return map;
	}
	@Override
	public int selectAllusers() {
		// TODO Auto-generated method stub
		return ad.selectAllusers();
	}
}
